import React, { Component } from "react";
import { observer } from "mobx-react";
import store from "../../../store";
export interface BddNumProps {}

export interface BddNumState {}
@observer
class BddNum extends Component<BddNumProps, BddNumState> {
  render() {
    return (
      <>
        <div>
          {store.user.num}
          <button onClick={this.handleDec}>+</button>
          <button onClick={this.handleInc}>-</button>
        </div>
      </>
    );
  }
  handleDec = () => {
    store.user.changeNum();
    // this.forceUpdate();
  };
  handleInc = () => {
    store.user.subNum();
    // this.forceUpdate();
  };
}

export default BddNum;
